#include "as_strided_n_d.h"

using namespace AsStrided;

extern "C" __global__ __aicore__ void as_strided(GM_ADDR x, GM_ADDR size, GM_ADDR stride, GM_ADDR storage_offset,
                                                 GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling) {
    GET_TILING_DATA(tilingData, tiling);
    if (TILING_KEY_IS(101)) {
        AsStridedND<float> op;
        op.Init(x, size, stride, storage_offset, y, &tilingData);
        op.ProcessNormal();
    } else if (TILING_KEY_IS(201)) {
        AsStridedND<half> op;
        op.Init(x, size, stride, storage_offset, y, &tilingData);
        op.ProcessNormal();
    } else if (TILING_KEY_IS(301)) {
        AsStridedND<int32_t> op;
        op.Init(x, size, stride, storage_offset, y, &tilingData);
        op.ProcessNormal();
    }
}